USE [WSS_Content_80]
GO
/****** Object:  StoredProcedure [dbo].[proc_WebList]    Script Date: 03/21/2011 17:56:40 ******/
-- =============================================  
-- Author:  <Bhupender Bindra>  
-- Create date: <04-11-11>  
-- Description: <To get Web list>  
-- ============================================= 
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[proc_WebList]
   @UserName                     nvarchar(255) 
AS
   Begin
		select W.Title,W.FullUrl,W.TimeCreated,W.Description
		,(Select top 1 USF.tp_Title From UserInfo USF where USF.tp_SiteAdmin=1 and UF.tp_SiteID = USF.tp_SiteID order by USF.tp_SiteID)
		as tp_Title
		from Webs W,UserInfo UF
		where 
		(UF.tp_Login=@UserName or UF.tp_Login='i:0#.f|sqlmember|'+@UserName) 
		and W.FullUrl!='' and W.FullUrl like '%projects/%'
		and UF.tp_SiteID = W.SiteId and W.TemplateVersion!='3' and UF.tp_Token is not null
		and W.SiteId not in 
		(Select SD.SiteId from SiteDeletion SD)
     End


